// StepWaveProb.H

#ifndef STEPWAVEPROB_H
#define STEPWAVEPROB_H

#include <math.h>

#include "Global.H"
#include "WaveProb.H"

// Forward Declarations
class Epetra_SerialComm;
class Epetra_Map; 
class Epetra_Vector;
class Epetra_Import;
class Epetra_CrsGraph;
class Epetra_CrsMatrix;


// P0 <= P1 <= P2 < 0
class StepWaveProb : public WaveProb
{ 
  private:
    double P1;	
    double P2;
    double A1;
    double A2;
    double A3;

	//Gamma: [0, |P0|] -> R
    double Gamma(double p)
    {
      double val;
      if (p >= 0)
        val = A3;
      if (p >= fabs(P2))
        val = A2;
      if (p >= fabs(P1))
      	val =  A1;
	  return val;
    }
    double computeLambda();
    void initQ(double lambda);
    void computeInitial(double lambda);


  public:
    StepWaveProb(int m, int n, double p0, double p1, double p2, double a1, double a2, double a3);
    explicit StepWaveProb(char *solfile);
    ~StepWaveProb();

    double getP1() const { return P1; }
    double getP2() const { return P2; }
    double getA1() const { return A1; }
    double getA2() const { return A2; }
    double getA3() const { return A3; }

    void setP1(double to) { P1 = to; }
    void setP2(double to) { P2 = to; }
    void setA1(double to) { A1 = to; }
    void setA2(double to) { A2 = to; }
    void setA3(double to) { A3 = to; }
};

#endif

